<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<meta charset="UTF-8">
    <link rel="stylesheet" href="${initParam.root}css/table.css" type="text/css">
    <link rel="stylesheet" href="${initParam.root}css/button.css" type="text/css">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
$(document).ready(function(){
	$("#transactionForm").submit(function(){
		if(confirm("결제하시겠습니까?")==false){
			return false;
		}
	});
});//ready

</script>
<form method="post" id="transactionForm" action="transaction.do">
	<table border="1" class="registerMemberTable"  style="margin: 0 auto ; width: 500px" >
		<tr>
			<td colspan="2">상품리스트</td></tr>
			<tr><td colspan="2">
				<table class="registerMemberTable" style="margin: 0 auto ; width: 500px">
						<tr>
									<th class="no">NO</th>
									<th class="title">제목</th>
									<th class="count">수량</th>
									<th class="price">상품가격</th>
					</tr>
					<c:forEach var="transaction" items="${requestScope.list}" varStatus="i">
						<tr>
							<td>${i.count }</td>
							<td><a
								href="${initParam.root }common/showDealContents.do?dealNumber=${transaction.dealNumber }">
									${transaction.dealTitle }</a>
									<input type="hidden" name="dealNumber" value="${transaction.dealNumber }"></td>
							<td>${transaction.cartCount }
							<input type="hidden" name="cartCount" value="${transaction.cartCount }">
							</td>
							<td>${transaction.dealPrice }
							<input type="hidden" name="transactionPrice" value="${transaction.dealPrice }">
							</td>
						</tr>
						<c:set var="total" value="${total+transaction.dealPrice }" />
					</c:forEach>
				</table>
			</td>
		</tr>
				<tr>
		<td colspan="2">배송정보</td>
		</tr>
		<tr>
		<td>구매자 아이디</td>
		<td><input type="text" name="customerId" value="${sessionScope.login.customerId }" readonly="readonly"></td>
		</tr>
		<tr>
		<td>이름</td>
		<td><input type="text" name="transactionName" value="${sessionScope.login.customerName }" required="required"></td>
		</tr>
				<tr>
		<td>전화번호</td>
		<td><input type="text" name="transactionTel" value="${sessionScope.login.customerTel }"required="required"></td>
		</tr>
				<tr>
		<td>배송주소</td>
		<td><input type="text" name="transactionAddress" value="${sessionScope.login.customerAddress }"required="required"></td>
		</tr>
				<tr>
		<td>결제방식</td>
		<td><input type="radio" name="transactionType" value="deposit" checked="checked">무통장입금</td>
		</tr>
						<tr>
		<td>결제금액</td>
		<td colspan="2" align="right">총 결제금액 :${total }
			<input type="hidden" name="transactionTotalPrice" value="${total}">
			</td>
		</tr>
		<tr>
		<td colspan="2" align="center"><input type="submit" value="결제하기"></td>
		</tr>
	</table>
</form>
